using System;
using RomanJendrusz.Amazon.ETL.Domain;
using RomanJendrusz.Amazon.ETL.Messages;
using NUnit.Framework.SyntaxHelpers;
using System.Collections.Generic;

namespace AmazonTests.Utils
{
    public static class New
    {
        private const decimal InchesToCm = 2.54m;
        private const decimal PoundsToKilograms = 2.2m;
        public static readonly Author ErichGamma = new Author {FullName = "Erich Gamma"};
        public static readonly Author JohnVlissides = new Author {FullName = "John M. Vlissides"};
        public static readonly Author KentBeck = new Author {FullName = "Kent Beck"};
        public static readonly Author MartinFowler = new Author {FullName = "Martin Fowler"};
        public static readonly Author RalphJohnson = new Author {FullName = "Ralph Johnson"};
        public static readonly Author RichardHelm = new Author {FullName = "Richard Helm"};
        public static GetSimiliarBooksRequest RefactoringSimiliarBooksRequest
        {
            get
            {
                var request = new GetSimiliarBooksRequest
                                  {
                                      BookAsin = Refactoring.ISBN,
                                      CorrelationId = Guid.NewGuid()
                                  };
                return request;
            }
        }

        public static GetSimiliarBooksResponse RefactoringSimiliarBooksResponse
        {
            get
            {
                var response = new GetSimiliarBooksResponse(Guid.NewGuid())
                                   {
                                       SimiliarBooks = new List<Book>
                                                           {
                                                               new Book {Asin = GoFDesignPatterns.Asin},
                                                               new Book {Asin = PatternsOfEnterpriseApplicationArchitecture.Asin}
                                                           }
                                   };
                return response;
            }
        }

        public static SellerOffer RefactoringOffer
        {
            get
            {
                var offer = new SellerOffer
                                {
                                    Book = Refactoring,
                                    Availability = "Usually ships in 1-2 business days",
                                    CoditionNote =
                                        "Brand new. Please allow 7 to 10 BUSINESS DAYS for delivery after receipt of order. We cannot ship to post office box addresses.",
                                    Condition = "New",
                                    Currency = Currency.USD,
                                    Price = 43.99m,
                                    EndDate = DateTime.Now.AddDays(2),
                                    StartDate = DateTime.Now.AddDays(-1),
                                    ExchangeId = "Y03Y2925528Y6683721",
                                    IsEligibleForSuperSaverShipping = false,
                                    Quantity = 13,
                                };
                return offer;
            }
        }

        

        public static Book GoFDesignPatterns
        {
            get
            {
                var gofBook = new Book
                                  {
                                      Asin = "0201633612",
                                      Binding = "Hardcover",
                                      DetailPageURL =
                                          "http://www.amazon.com/gp/redirect.html%3FASIN=0201633612%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0201633612%253FSubscriptionId=1FSSNYS4T9YMWMNCBQG2",
                                      EAN = "9780201633610",
                                      Height = (1.18m*InchesToCm),
                                      Width = (7.40m*InchesToCm),
                                      Length = (9.37m*InchesToCm),
                                      Weight = (2.34m/PoundsToKilograms),
                                      ISBN = "0201633612",
                                      Label = "Addison-Wesley Professional",
                                      Language = "English",
                                      Manufacturer = "Addison-Wesley Professional",
                                      NumberOfItems = 1,
                                      NumberOfPages = 416,
                                      Price = 54.59m,
                                      PriceCurrency = Currency.USD,
                                      PublicationDate = DateTime.Parse("1994-11-10"),
                                      Publisher = "Addison-Wesley Professional",
                                      Studio = "Addison-Wesley Professional",
                                      Title =
                                          "Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional Computing Series)",
                                      UPC = "785342633610"
                                  };
                return gofBook;
            }
        }

        public static Book PatternsOfEnterpriseApplicationArchitecture
        {
            get
            {
                var gofBook = new Book
                                  {
                                      Asin = "0321127420",
                                      Binding = "Hardcover",
                                      DetailPageURL =
                                          "http://www.amazon.com/gp/redirect.html%3FASIN=0321127420%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0321127420%253FSubscriptionId=1FSSNYS4T9YMWMNCBQG2",
                                      EAN = "9780321127426",
                                      Height = (1.34m*InchesToCm),
                                      Width = (7.56m*InchesToCm),
                                      Length = (9.37m*InchesToCm),
                                      Weight = (2.29m/PoundsToKilograms),
                                      ISBN = "0321127420",
                                      Label = "Addison-Wesley Professional",
                                      Language = "English",
                                      Manufacturer = "Addison-Wesley Professional",
                                      NumberOfItems = 1,
                                      NumberOfPages = 560,
                                      Price = 64.99m,
                                      PriceCurrency = Currency.USD,
                                      PublicationDate = DateTime.Parse("2002-11-15"),
                                      Publisher = "Addison-Wesley Professional",
                                      Studio = "Addison-Wesley Professional",
                                      Title =
                                          "Patterns of Enterprise Application Architecture (The Addison-Wesley Signature Series)",
                                      UPC = "076092019909"
                                  };
                return gofBook;
            }
        }

        public static Book Refactoring
        {
            get
            {
                var gofBook = new Book
                                  {
                                      Asin = "0201485672",
                                      Binding = "Hardcover",
                                      DetailPageURL =
                                          "http://www.amazon.com/gp/redirect.html%3FASIN=0321127420%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0321127420%253FSubscriptionId=1FSSNYS4T9YMWMNCBQG2",
                                      EAN = "9780201485677",
                                      Height = (1.34m*InchesToCm),
                                      Width = (7.56m*InchesToCm),
                                      Length = (9.37m*InchesToCm),
                                      Weight = (2.29m/PoundsToKilograms),
                                      ISBN = "0201485672",
                                      Label = "Addison-Wesley Professional",
                                      Language = "English",
                                      Manufacturer = "Addison-Wesley Professional",
                                      NumberOfItems = 1,
                                      NumberOfPages = 464,
                                      Price = 59.99m,
                                      PriceCurrency = Currency.USD,
                                      PublicationDate = DateTime.Parse("1999-07-08"),
                                      Publisher = "Addison-Wesley Professional",
                                      Studio = "Addison-Wesley Professional",
                                      Title =
                                          "Refactoring: Improving the Design of Existing Code (The Addison-Wesley Object Technology Series)",
                                      UPC = "785342485677"
                                  };
                return gofBook;
            }
        }

        public static CustomerReview GoFDesignPatternsReview
        {
            get
            {
                var review = new CustomerReview();
                review.Book = GoFDesignPatterns;
                review.Summary = "very attractive cover";
                review.Content =
                    "unlike the last pattern book i reviewed (see my other reviews), this one has an attractive cover.  i like blue.   <br /><br />";
                review.Rating = 5;
                review.HelpfulVotes = 0;
                review.TotalVotes = 2;
                review.AddedDate = DateTime.Parse("2008-05-05");
                return review;
            }
        }

        public static CustomerReview AnotherGoFDesignPatternsReview
        {
            get
            {
                var review = new CustomerReview();
                review.Book = GoFDesignPatterns;
                review.Summary = "very attractive cover";
                review.Content =
                    "unlike the last pattern book i reviewed (see my other reviews), this one has an attractive cover.  i like blue.   <br /><br />";
                review.Rating = 5;
                review.HelpfulVotes = 0;
                review.TotalVotes = 2;
                review.AddedDate = DateTime.Parse("2008-05-05");
                return review;
            }
        }

        public static CustomerReview RefactoringReview
        {
            get
            {
                var review = new CustomerReview();
                review.Book = Refactoring;
                review.Summary = " Must have in any developers collection";
                review.Content =
                    @"I was referred to this book from a colleague after a quick discussion on 'Replace temp with Query' in our projects code baseI thought I knew it all as a software developer, but reading this book, I soon came to realize that as a software developer I was leaving a legacy of code that was not at the standard it should be.
                        This book opened my eyes to some really simple concepts, for example, when trying to understand code someone else has written (or yourself in some cases) take the time to re-factor the code (i.e. Extract Method) so that the code is understandable, since most of the work is spent in trying to understand the code in the first place. 
                        This concept of modifying code as you understand it is superb.";
                review.Rating = 5;
                review.HelpfulVotes = 0;
                review.TotalVotes = 0;
                review.AddedDate = DateTime.Parse("2008-05-16");
                return review;
            }
        }

        public static CustomerReview AnotherRefactoringReview
        {
            get
            {
                var review = new CustomerReview();
                review.Book = Refactoring;
                review.Summary = " Must have in any developers collection";
                review.Content =
                    @"I was referred to this book from a colleague after a quick discussion on 'Replace temp with Query' in our projects code baseI thought I knew it all as a software developer, but reading this book, I soon came to realize that as a software developer I was leaving a legacy of code that was not at the standard it should be.
                        This book opened my eyes to some really simple concepts, for example, when trying to understand code someone else has written (or yourself in some cases) take the time to re-factor the code (i.e. Extract Method) so that the code is understandable, since most of the work is spent in trying to understand the code in the first place. 
                        This concept of modifying code as you understand it is superb.";
                review.Rating = 5;
                review.HelpfulVotes = 0;
                review.TotalVotes = 0;
                review.AddedDate = DateTime.Parse("2008-05-16");
                return review;
            }
        }

        public static Customer DanielEngelmann
        {
            get
            {
                var customer = new Customer
                                   {
                                       BirthDay = "20 May",
                                       City = "Las Vegas",
                                       Country = "United States of America",
                                       State = "Nevada",
                                       CustomerId = "A1API6DR9KU3L4",
                                       Nickname = "daniel50615"
                                   };
                return customer;
            }
        }

        public static Customer DaveKoziokowski
        {
            get
            {
                var customer = new Customer
                                   {
                                       BirthDay = "24 April",
                                       City = "Houston",
                                       Country = "United States of America",
                                       State = "Texas",
                                       CustomerId = "A26DS3QFQ07ECK",
                                       Nickname = "davekozikowski"
                                   };
                return customer;
            }
        }

        public static WishList EmptyWishlist
        {
            get
            {
                var list = new WishList
                               {
                                   ListName = "WishList",
                                   CreatedDate = DateTime.Now,
                                   LastUpdated = DateTime.Now,
                                   ListId = "223OJ6C9W03WX",
                                   ListUrl = "http://www.amazon.com/gp/registry/wishlist/223OJ6C9W03WX",
                                   TotalPossibleItems = 2
                               };
                return list;
            }
        }

        public static ListMania EmptyListmania
        {
            get
            {
                var list = new ListMania
                               {
                                   ListName = "ListMania",
                                   CreatedDate = DateTime.Now,
                                   LastUpdated = DateTime.Now,
                                   ListId = "223OJ6C9W03WX",
                                   ListUrl = "http://www.amazon.com/gp/registry/wishlist/223OJ6C9W03WX",
                                   TotalPossibleItems = 2
                               };
                return list;
            }
        }

        public static ListItem GofDesignPatternsListItem
        {
            get
            {
                var listItem = new ListItem
                                   {
                                       Book = GoFDesignPatterns,
                                       DateAdded = DateTime.Now,
                                       ListItemId = "IBGLDATTCDF8R",
                                       QuantityDesired = 1,
                                       QuantityReceived = 0
                                   };
                return listItem;
            }
        }

        public static Seller OlympicMarketBookSeller
        {
            get
            {
                var seller = new Seller
                                 {
                                     SellerId = "A1X2R1568DGTDB",
                                     GlancePage =
                                         "http://www.amazon.com/gp/help/seller/at-a-glance.html?seller=A1X2R1568DGTDB&marketplaceSeller=1",
                                     LegalName = null,
                                     Name = null,
                                     NickName = "olympic_market_book_sellers"
                                 };
                return seller;
            }
        }

        public static SellerFeedback OlympicMarketBookFeedback
        {
            get
            {
                var feedback = new SellerFeedback
                                   {
                                       Rating = 4,
                                       Commect = "Good Service",
                                       Created = DateTime.Parse("2008-05-21T02:22+0000"),
                                       Seller = OlympicMarketBookSeller
                                   };
                return feedback;
            }
        }

        public static GetBookDetailsRequest RefactoringBookDetailsRequest
        {
            get { return new GetBookDetailsRequest {Identifier = Refactoring.ISBN}; }
        }

        public static GetBookDetailsResponse RefactoringBookDetailsResponse
        {
            get { return new GetBookDetailsResponse(Guid.NewGuid()) {IsValid = true, RetrievedBook = Refactoring}; }
        }

        public static GetBookDetailsRequest GofBookDetailsRequest
        {
            get { return new GetBookDetailsRequest { Identifier = GoFDesignPatterns.ISBN }; }
        }

        public static GetBookDetailsResponse GoFBookDetailsResponse
        {
            get { return new GetBookDetailsResponse(Guid.NewGuid()) { IsValid = true, RetrievedBook = GoFDesignPatterns }; }
        }
    }
}